package cn.lls.interceptor;

import cn.lls.base.common.LlsEnum;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.HandlerInterceptor;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * 超级管理员的拦截器，控制超级管理员的权限
 * @ClassName SAInterceptor
 * @Author 划水艺术家
 * @Date 2022/11/18 16:39
 * @Version 1.0
 **/
@Component
public class SAInterceptor implements HandlerInterceptor {

    @Autowired
    private MutualInterceptor mutualInterceptor;

    @Override
    public boolean preHandle(HttpServletRequest httpServletRequest,
                             HttpServletResponse httpServletResponse, Object o) throws IOException {
        return mutualInterceptor.preHandle(httpServletRequest, httpServletResponse,
                o, LlsEnum.LlsIdentify.SUPER_ADMIN.getIdentify());
    }

}
